/*
 * Chandni Sabhaya
 * Reviewer South panel.
 * Date: 12/3/2011
 */
package gui.reviewer;

import gui.CAControl;
import gui.CAFrame;

import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Observable;
import java.util.Observer;

import javax.swing.JButton;
import javax.swing.JPanel;

import caobject.Conference;


/**
 * This is the class that holds the south panel of the frame
 * when the user is a reviewer 
 *   
 * @author Chandni Sabhaya
 * @version December 3, 2011
 * 
 */
@SuppressWarnings("serial")
public class ReviewerSouthPanel extends JPanel implements Observer {

	/**
	 * Parent Frame
	 */
	private final CAFrame my_parent;

	private final JButton my_mainMenuButton = new JButton("Main Menu");

	/**
	 * Panel Conference Reference
	 */
	private final Conference my_conf;

	/**
	 * Panel Control Reference
	 */
	private final CAControl my_control;

	/**
	 * Conference Assistant South Panel Constructor
	 * 
	 * @param the_conf
	 *            Conference Reference
	 * @param the_control
	 *            Control Reference
	 */
	public ReviewerSouthPanel(final CAFrame parentFrame,
			final Conference the_conf, final CAControl the_control) {
		my_parent = parentFrame;
		my_conf = the_conf;

		my_control = the_control;
		my_control.addObserver(ReviewerSouthPanel.this);

		setup();
	}

	/**
	 * Panel Setup Method
	 */
	private void setup() {
		setLayout(new FlowLayout(FlowLayout.CENTER));

		// Main Menu Button
		my_mainMenuButton.addActionListener(new ActionListener() {
			public void actionPerformed(final ActionEvent event) {
				my_parent.displayWelcome();
			}
		});

		add(my_mainMenuButton);

	}

	/**
	 * Method used to update the panel
	 */
	@Override
	public void update(final Observable the_observable, final Object the_obj) {

	}

}
